<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "upload".
 *
 * @property integer $upload_id
 * @property string $create_time
 * @property string $hash
 * @property string $path
 * @property string $resource
 * @property string $extension
 */
class Upload extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'upload';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['upload_id', 'create_time'], 'required'],
            [['upload_id'], 'integer'],
            [['create_time'], 'safe'],
            [['hash'], 'string', 'max' => 50],
            [['path'], 'string', 'max' => 255],
            [['resource', 'extension'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'upload_id' => 'Upload ID',
            'create_time' => '创建时间',
            'hash' => '文件哈希值',
            'path' => '路径',
            'resource' => '来源',
            'extension' => '扩展',
        ];
    }
}
